<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>qrcode.js插件将你的内容转换成二维码格式</title>
        <link rel="stylesheet" href="../../css/QrCode.css">
    </head>
    <body>
        <div class="lanren">
            <input type="text" id="contents">
            <button id="send">点击生成二维码</button>
            <div id="qrcode"></div>
        </div>
        <script src="../../jss/qrcode.js"></script>
        <script>
            window.onload = function() {
                var content = document.getElementById("qrcode");
                var qrcode = new QRCode(content, {
                    width: 200,
                    height: 200
                });
                document.getElementById("send").onclick = function() {
                    var value = document.getElementById("contents").value;
                    qrcode.makeCode(value);
                    content.style.display = "block";
                }
            }
        </script>
    </body>

</html>